package net.miranti;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQuery;

@NamedQuery(name=User.FIND_BY_LOGIN, query=User.FIND_BY_LOGIN_QUERY)
@Entity
public class User implements Serializable{
	public static final String FIND_BY_LOGIN = "FIND_USER_BY_LOGIN";
	private static final String FIND_BY_LOGIN_QUERY = "from User where login=:login";
	
	public static final String SESSION_NAME = "loggedUser";

	@Id	@GeneratedValue
	private Long id;
	private String name, login, password;
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	
	public String getLogin() {
		return login;
	}
	public void setLogin(String login) {
		this.login = login;
	}
	
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}
}